コードブロック記法で1つのソースコードを複数のsyntax highlightで表示
deinのtoml設定ファイルをscrapboxに転記している最中に気づいたtakker.icon 例
末尾の()が違っていても、1つのファイルとして取得できるようだ
code:coc.nvim.toml
plugins
repo = 'neoclide/coc-denite'
plugins
repo = 'neoclide/coc.nvim'
merge = 0
rev = 'release'
build = 'yarn install --frozen-lockfile'
hook_add = '''
code:coc.nvim.toml(vim)
let g:coc_filetype_map = {
\ 'svg': 'xml',
\ }
" Note: g:coc_config_homeはbasic.vimに記述。
" use <tab> for trigger completion and navigate to next complete item
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')col - 1 =~ '\s' endfunction
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<c-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
inoremap <silent><expr> <cr> "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" mapping for snippets
imap <C-j> <Plug>(coc-snippets-expand-jump)
let g:coc_snippet_next = '<C-j>'
let g:coc_snippet_prev = '<C-k>'
" coc-actions
" Remap for do codeAction of selected region
function! s:cocActionsOpenFromSelected(type) abort
execute 'CocCommand actions.open ' . a:type
endfunction
xmap <silent> LangServera :<C-u>execute 'CocCommand actions.open ' . visualmode()<CR> nmap <silent> LangServera :<C-u>set operatorfunc=<SID>cocActionsOpenFromSelected<CR>g@ " navigate diagnostics
nmap <silent> [c <Plug>(coc-diagnostic-prev)
nmap <silent> ]c <Plug>(coc-diagnostic-next)
"スペースhでHover
nnoremap <silent> LangServerh :<C-u>call CocAction('doHover')<cr> ""スペースdfでDefinition
"スペースrfでReferences
nnoremap <silent> LangServere :<C-u>Denite coc-diagnostic<cr> nnoremap <silent> LangServerc :<C-u>Denite coc-command<CR> nnoremap <silent> LangServerC :<C-u>Denite coc-command -start-filter<CR> command! -nargs=0 CocFormat :call CocAction('format')
function! s:cocFormatMapping()
if CocHasProvider("format")
return ":\<C-u>CocFormat\<CR>"
else
return &filetype == 'markdown' ? ":\<C-u>CocCommand markdownlint.fixAll\<CR>" : "=G"
endif
endfunction
nnoremap <silent><expr> =G <SID>cocFormatMapping()
code:coc.nvim.toml
'''
hook_source='''
code:coc.nvim.toml(vim)
call coc#add_extension(
\ 'coc-dictionary',
\ 'coc-fish',
\ 'coc-json',
\ 'coc-markdownlint',
\ 'coc-marketplace',
\ 'coc-omnisharp',
\ 'coc-pairs',
\ 'coc-snippets',
\ 'coc-syntax',
\ 'coc-denoland',
\ 'coc-tsserver',
\ 'coc-vimlsp',
\ 'coc-word',
\ 'coc-xml',
\ 'coc-git',
\ 'coc-actions'
\ )
code:coc.nvim.toml
'''